Accept Merge Request #833: (feature/修复日计划工单接口和http -> develop)

Merge Request: 修复日计划工单接口和http

Created By: @杨金灵
Reviewed By: @马广威
Approved By: @马广威 
Accepted By: @杨金灵
URL: https://jikimo-hn.coding.net/p/jikimo_sfs/d/jikimo_sf/git/merge/833?initial=true
This commit is contained in:
杨金灵
2024-02-22 18:54:15 +08:00
committed by Coding
3 changed files with 5 additions and 6 deletions

View File

@@ -46,7 +46,7 @@ class Http(models.AbstractModel):
_logger.info('check_sf_str:%s' % check_sf_str)
_logger.info('check_str:%s' % check_str)
_logger.info('sf_secret_key:%s' % factory_secret.sf_secret_key)
# if check_sf_str != datas['HTTP_CHECKSTR']:
# raise AuthenticationError('数据校验不通过')
if check_sf_str != datas['HTTP_CHECKSTR']:
raise AuthenticationError('数据校验不通过')
else:
raise AuthenticationError('请求参数中无token')

View File

@@ -22,8 +22,7 @@ class Manufacturing_Connect(http.Controller):
ret = json.loads(datas)
logging.info('RfidCode:%s' % ret['RfidCode'])
if 'RfidCode' in ret:
workorder = request.env['mrp.workorder'].sudo().search(
[('rfid_code', '=', ret['RfidCode']), ('routing_type', '=', '装夹预调')])
workorder = request.env['mrp.workorder'].sudo().search([('rfid_code', '=', ret['RfidCode'])])
if workorder:
for item in workorder:
res['Datas'].append({

View File

@@ -135,6 +135,8 @@ class ResMrpWorkOrder(models.Model):
workpiece_delivery_ids = fields.One2many('sf.workpiece.delivery', 'workorder_id', '工件配送')
is_delivery = fields.Boolean('是否配送完成', default=False)
rfid_code = fields.Char('RFID')
production_line_id = fields.Many2one('sf.production.line', related='production_id.production_line_id',
string='生产线')
def get_plan_workorder(self, production_line):
tomorrow = (date.today() + timedelta(days=+1)).strftime("%Y-%m-%d")
@@ -875,5 +877,3 @@ class CMMprogram(models.Model):
post_processing_name = fields.Char('后处理名称')
program_date = fields.Datetime('程序日期')
workorder_id = fields.Many2one('mrp.workorder', string="工单")