/// <summary> /// 取得所有任务模板 /// </summary> /// <returns></returns> public static void updateTaskTemplate(String TEMPLATE_ID, String TEMPLATE_XML) { String sql = "update t_task_template set TEMPLATE_XML='" + TEMPLATE_XML + "' where TEMPLATE_ID = '" + TEMPLATE_ID + "'"; SQLmtm.ExecuteSql(sql); }
/// <summary> /// 指定门店出入库 /// </summary> /// <param name="enum进出库类型"></param> /// <param name="barCode"></param> /// <param name="shop_id"></param> private static void generate门店扫码出入库(Enum进出库类型 enum进出库类型, String barCode, String shop_id) { String sql = "SELECT dispath_type FROM a_noorder_print_p WHERE clothes_log_id = '" + barCode + "'"; DataTable dataTable = SQLmtm.GetDataTable(sql); if (dataTable.Rows.Count == 0) { throw new Exception("条码" + barCode + "不存在!"); } else { Enum在库类别 enum在库类别; try { enum在库类别 = (Enum在库类别)Convert.ToInt32(dataTable.Rows[0]["dispath_type"].ToString()); } catch { enum在库类别 = Enum在库类别.成品仓; } if (enum在库类别.Equals(Enum在库类别.已出库) && enum进出库类型.Equals(Enum进出库类型.出库)) { throw new Exception("条码" + barCode + "已出库!"); } if (enum在库类别.Equals(Enum在库类别.在库) && enum进出库类型.Equals(Enum进出库类型.入库)) { throw new Exception("条码" + barCode + "已入库!"); } } // 生成库存明细账 sql = "INSERT INTO t_inventory_sub_ledger ( shop_id, ref_style_id, style_fabric_id, amount, bill_id, STYLE_SIZE_CD, create_date ) SELECT\n" + shop_id + ",\n" + "style_id,\n" + "materials_id,\n"; if (enum进出库类型.Equals(Enum进出库类型.出库)) { sql += "-1,\n"; } else { sql += "1,\n"; } sql += "clothes_log_id,\n" + "size_cd,\n" + "now( ) \n" + "FROM\n" + " a_noorder_print_p \n"+ "WHERE\n" + " clothes_log_id = '"+ barCode + "'"; SQLmtm.ExecuteSql(sql); // 更新库存状态 sql = "update a_noorder_print_p set dispath_type = '" + (int)getEnum在库类别(enum进出库类型) + "' WHERE clothes_log_id = '" + barCode + "'"; SQLmtm.ExecuteSql(sql); }
/// <summary> /// 产品下线方法 /// </summary> /// <param name="下线DTO"></param> internal static void Func产品下线(线DTO 线DTO) { // 审核表 String sql = "INSERT INTO t_rolloff ( id, create_date, CODE, flag )\n" + "VALUES\n" + " ( '"+ 线DTO.Id + "', NOW( ), '" + 线DTO.Code + "', 0 );"; SQLmtm.ExecuteSql(sql); // 关联表 foreach (DXApplicationTangche.UC.门店下单.DTO.款式图片一览Dto 款式图片一览Dto in 线DTO.款式一览) { sql = "INSERT INTO r_rolloff_style ( ROLLOFF_ID, STYLE_ID )\n" + "VALUES\n" + " ( '" + 线DTO.Id + "', '" + 款式图片一览Dto.SYS_STYLE_ID + "' );"; SQLmtm.ExecuteSql(sql); } }
/// <summary> /// 新增库存明细账 /// </summary> /// <param name="barIds">条形码id</param> /// <param name="shop_id">门店id</param> /// <param name="bill_id">单号</param> /// <param name="stockType">出入库类型</param> /// <param name="isStockOut">出否出库,如果是,就是负数</param> public static void generateInventoryLedge(List <String> barIds, String shop_id, String bill_id, String stockType, bool isStockOut) { String sql = "INSERT INTO t_inventory_sub_ledger ( shop_id, ref_style_id, style_fabric_id, ledger_type, amount, bill_id ) SELECT" + " '" + shop_id + "' AS shop_id," + " STYLE_ID," + " SYTLE_FABRIC_ID," + " '" + stockType + "'," + (isStockOut ? " 0 - " : "") + " count(id) AS id_count," + " '" + bill_id + "' AS bill_id" + " FROM" + " a_product_log_p" + " WHERE" + " a_product_log_p.id IN( '" + String.Join("','", barIds) + "' ) " + " GROUP BY" + " STYLE_ID," + " SYTLE_FABRIC_ID"; SQLmtm.ExecuteSql(sql); }
/// <summary> /// 执行下线 /// </summary> /// <param name="下线DTOs"></param> public static void doRollOff(List <线DTO> 线DTOs) { // 执行款式下线 List <String> 线StyleIds = new List <string>(); List <String> 线logIds = new List <string>(); foreach (线DTO 线DTO in 线DTOs) { foreach (DXApplicationTangche.UC.门店下单.DTO.款式图片一览Dto 款式图片一览Dto in 线DTO.款式一览) { 线StyleIds.Add(款式图片一览Dto.SYS_STYLE_ID); } 线logIds.Add(线DTO.Id); } String sql = "UPDATE s_style_p \n" + "SET ENABLE_FLAG = 0 \n" + "WHERE\n" + " SYS_STYLE_ID IN ( '"+ String.Join("','", 线StyleIds) + "' );"; SQLmtm.ExecuteSql(sql); // log变更 sql = "update t_rolloff set flag = 1 where id in ('" + String.Join("','", 线logIds) + "');"; SQLmtm.ExecuteSql(sql); }